//
//
//  位置补偿界面
//
//


import QtQuick
import QtQuick.Layouts

Item {
    width: rootWidth
    height: rootHeight /*- 150*/

    A_NumberKeyboard{
        id: locationSettingKeyboard
        isDirectOverwrite: false
    }

    Component.onCompleted: {
        // console.log("生成！！ - 位置补偿")
        Cpp_PLC.QML_CurrentPage = 15;
    }

    // Component.onDestruction: {
    //     console.log("销毁 - 位置补偿")
    // }


    Rectangle{
        anchors.top: parent.top
        anchors.topMargin: 10
        anchors.horizontalCenter: parent.horizontalCenter
        width: rootWidth - 20
        height: 1050
        color: "transparent"
        border.width: 1



        ColumnLayout{
            // anchors.top: parent.top
            // anchors.topMargin: 100
            anchors.horizontalCenter: parent.horizontalCenter


            Item{
                width: 1040
                height: 100

                RowLayout{
                    anchors.verticalCenter: parent.verticalCenter

                    A_Label {
                        label_Data: "250"
                        label_pointSize: 40
                    }

                    // A_TextInput{
                    //     inputWidth: 300
                    //     showData: Cpp_PLC.Location_Compensate_01

                    //     onInputFinished: {
                    //         if(Number(inputData) < -9)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1302,"-9")
                    //         }
                    //         else if(Number(inputData) > 20)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1302,"20")
                    //         }
                    //         else
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1302,inputData)
                    //         }
                    //     }

                    // }

                    A_NumberInput{
                        inputWidth: 300
                        text: Cpp_PLC.Location_Compensate_01
                        minValue: -9
                        maxValue: 20
                        keyboard: locationSettingKeyboard

                        onEditingFinished: function(value) {
                            Cpp_PLC.write_Modbus_RTU_Hold_32(1302,value)
                        }
                    }

                    A_Label{
                        label_Data: "2750"
                        label_pointSize: 40
                    }

                    // A_TextInput{
                    //     inputWidth: 300
                    //     showData: Cpp_PLC.Location_Compensate_11

                    //     onInputFinished: {
                    //         if(Number(inputData) < -9)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1322,"-9")
                    //         }
                    //         else if(Number(inputData) > 20)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1322,"20")
                    //         }
                    //         else
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1322,inputData)
                    //         }
                    //     }
                    // }

                    A_NumberInput{
                        inputWidth: 300
                        text: Cpp_PLC.Location_Compensate_11
                        minValue: -9
                        maxValue: 20
                        keyboard: locationSettingKeyboard

                        onEditingFinished: function(value) {
                            Cpp_PLC.write_Modbus_RTU_Hold_32(1322,value)
                        }
                    }

                }

            }

            Item{

                width: 1040
                height: 100

                RowLayout{
                    anchors.verticalCenter: parent.verticalCenter

                    A_Label {
                        label_Data: "500"
                        label_pointSize: 40
                    }

                    // A_TextInput{
                    //     inputWidth: 300
                    //     showData: Cpp_PLC.Location_Compensate_02

                    //     onInputFinished: {
                    //         if(Number(inputData) < -9)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1304,"-9")
                    //         }
                    //         else if(Number(inputData) > 20)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1304,"20")
                    //         }
                    //         else
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1304,inputData)
                    //         }
                    //     }
                    // }

                    A_NumberInput{
                        inputWidth: 300
                        text: Cpp_PLC.Location_Compensate_02
                        minValue: -9
                        maxValue: 20
                        keyboard: locationSettingKeyboard

                        onEditingFinished: function(value) {
                            Cpp_PLC.write_Modbus_RTU_Hold_32(1304,value)
                        }
                    }

                    A_Label{
                        label_Data: "3000"
                        label_pointSize: 40
                    }

                    // A_TextInput{
                    //     inputWidth: 300
                    //     showData: Cpp_PLC.Location_Compensate_12

                    //     onInputFinished: {
                    //         if(Number(inputData) < -9)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1324,"-9")
                    //         }
                    //         else if(Number(inputData) > 20)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1324,"20")
                    //         }
                    //         else
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1324,inputData)
                    //         }
                    //     }
                    // }

                    A_NumberInput{
                        inputWidth: 300
                        text: Cpp_PLC.Location_Compensate_12
                        minValue: -9
                        maxValue: 20
                        keyboard: locationSettingKeyboard

                        onEditingFinished: function(value) {
                            Cpp_PLC.write_Modbus_RTU_Hold_32(1324,value)
                        }
                    }

                }

            }

            Item{

                width: 1040
                height: 100

                RowLayout{
                    anchors.verticalCenter: parent.verticalCenter

                    A_Label {
                        label_Data: "750"
                        label_pointSize: 40
                    }

                    // A_TextInput{
                    //     inputWidth: 300
                    //     showData: Cpp_PLC.Location_Compensate_03

                    //     onInputFinished: {
                    //         if(Number(inputData) < -9)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1306,"-9")
                    //         }
                    //         else if(Number(inputData) > 20)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1306,"20")
                    //         }
                    //         else
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1306,inputData)
                    //         }
                    //     }
                    // }

                    A_NumberInput{
                        inputWidth: 300
                        text: Cpp_PLC.Location_Compensate_03
                        minValue: -9
                        maxValue: 20
                        keyboard: locationSettingKeyboard

                        onEditingFinished: function(value) {
                            Cpp_PLC.write_Modbus_RTU_Hold_32(1306,value)
                        }
                    }

                    A_Label{
                        label_Data: "3250"
                        label_pointSize: 40
                    }

                    // A_TextInput{
                    //     inputWidth: 300
                    //     showData: Cpp_PLC.Location_Compensate_13

                    //     onInputFinished: {
                    //         if(Number(inputData) < -9)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1326,"-9")
                    //         }
                    //         else if(Number(inputData) > 20)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1326,"20")
                    //         }
                    //         else
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1326,inputData)
                    //         }
                    //     }
                    // }

                    A_NumberInput{
                        inputWidth: 300
                        text: Cpp_PLC.Location_Compensate_13
                        minValue: -9
                        maxValue: 20
                        keyboard: locationSettingKeyboard

                        onEditingFinished: function(value) {
                            Cpp_PLC.write_Modbus_RTU_Hold_32(1326,value)
                        }
                    }

                }

            }

            Item{

                width: 1040
                height: 100

                RowLayout{
                    anchors.verticalCenter: parent.verticalCenter

                    A_Label {
                        label_Data: "1000"
                        label_pointSize: 40

                    }

                    // A_TextInput{
                    //     inputWidth: 300
                    //     showData: Cpp_PLC.Location_Compensate_04

                    //     onInputFinished: {
                    //         if(Number(inputData) < -9)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1308,"-9")
                    //         }
                    //         else if(Number(inputData) > 20)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1308,"20")
                    //         }
                    //         else
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1308,inputData)
                    //         }
                    //     }
                    // }

                    A_NumberInput{
                        inputWidth: 300
                        text: Cpp_PLC.Location_Compensate_04
                        minValue: -9
                        maxValue: 20
                        keyboard: locationSettingKeyboard

                        onEditingFinished: function(value) {
                            Cpp_PLC.write_Modbus_RTU_Hold_32(1308,value)
                        }
                    }

                    A_Label{
                        label_Data: "3500"
                        label_pointSize: 40
                    }

                    // A_TextInput{
                    //     inputWidth: 300
                    //     showData: Cpp_PLC.Location_Compensate_14

                    //     onInputFinished: {
                    //         if(Number(inputData) < -9)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1328,"-9")
                    //         }
                    //         else if(Number(inputData) > 20)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1328,"20")
                    //         }
                    //         else
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1328,inputData)
                    //         }
                    //     }
                    // }

                    A_NumberInput{
                        inputWidth: 300
                        text: Cpp_PLC.Location_Compensate_14
                        minValue: -9
                        maxValue: 20
                        keyboard: locationSettingKeyboard

                        onEditingFinished: function(value) {
                            Cpp_PLC.write_Modbus_RTU_Hold_32(1328,value)
                        }
                    }

                }

            }

            Item{

                width: 1040
                height: 100

                RowLayout{
                    anchors.verticalCenter: parent.verticalCenter

                    A_Label {
                        label_Data: "1250"
                        label_pointSize: 40
                    }

                    // A_TextInput{
                    //     inputWidth: 300
                    //     showData: Cpp_PLC.Location_Compensate_05

                    //     onInputFinished: {
                    //         if(Number(inputData) < -9)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1310,"-9")
                    //         }
                    //         else if(Number(inputData) > 20)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1310,"20")
                    //         }
                    //         else
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1310,inputData)
                    //         }
                    //     }
                    // }

                    A_NumberInput{
                        inputWidth: 300
                        text: Cpp_PLC.Location_Compensate_05
                        minValue: -9
                        maxValue: 20
                        keyboard: locationSettingKeyboard

                        onEditingFinished: function(value) {
                            Cpp_PLC.write_Modbus_RTU_Hold_32(1310,value)
                        }
                    }

                    A_Label{
                        label_Data: "3750"
                        label_pointSize: 40
                    }

                    // A_TextInput{
                    //     inputWidth: 300
                    //     showData: Cpp_PLC.Location_Compensate_15

                    //     onInputFinished: {
                    //         if(Number(inputData) < -9)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1330,"-9")
                    //         }
                    //         else if(Number(inputData) > 20)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1330,"20")
                    //         }
                    //         else
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1330,inputData)
                    //         }
                    //     }
                    // }

                    A_NumberInput{
                        inputWidth: 300
                        text: Cpp_PLC.Location_Compensate_15
                        minValue: -9
                        maxValue: 20
                        keyboard: locationSettingKeyboard

                        onEditingFinished: function(value) {
                            Cpp_PLC.write_Modbus_RTU_Hold_32(1330,value)
                        }
                    }

                }

            }

            Item{

                width: 1040
                height: 100

                RowLayout{
                    anchors.verticalCenter: parent.verticalCenter

                    A_Label {
                        label_Data: "1500"
                        label_pointSize: 40
                    }

                    // A_TextInput{
                    //     inputWidth: 300
                    //     showData: Cpp_PLC.Location_Compensate_06

                    //     onInputFinished: {
                    //         if(Number(inputData) < -9)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1312,"-9")
                    //         }
                    //         else if(Number(inputData) > 20)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1312,"20")
                    //         }
                    //         else
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1312,inputData)
                    //         }
                    //     }
                    // }

                    A_NumberInput{
                        inputWidth: 300
                        text: Cpp_PLC.Location_Compensate_06
                        minValue: -9
                        maxValue: 20
                        keyboard: locationSettingKeyboard

                        onEditingFinished: function(value) {
                            Cpp_PLC.write_Modbus_RTU_Hold_32(1312,value)
                        }
                    }

                    A_Label{
                        label_Data: "4000"
                        label_pointSize: 40
                    }

                    // A_TextInput{
                    //     inputWidth: 300
                    //     showData: Cpp_PLC.Location_Compensate_16

                    //     onInputFinished: {
                    //         if(Number(inputData) < -9)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1332,"-9")
                    //         }
                    //         else if(Number(inputData) > 20)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1332,"20")
                    //         }
                    //         else
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1332,inputData)
                    //         }
                    //     }
                    // }

                    A_NumberInput{
                        inputWidth: 300
                        text: Cpp_PLC.Location_Compensate_16
                        minValue: -9
                        maxValue: 20
                        keyboard: locationSettingKeyboard

                        onEditingFinished: function(value) {
                            Cpp_PLC.write_Modbus_RTU_Hold_32(1332,value)
                        }
                    }

                }

            }

            Item{

                width: 1040
                height: 100

                RowLayout{
                    anchors.verticalCenter: parent.verticalCenter

                    A_Label {
                        label_Data: "1750"
                        label_pointSize: 40
                    }

                    // A_TextInput{
                    //     inputWidth: 300
                    //     showData: Cpp_PLC.Location_Compensate_07

                    //     onInputFinished: {
                    //         if(Number(inputData) < -9)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1314,"-9")
                    //         }
                    //         else if(Number(inputData) > 20)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1314,"20")
                    //         }
                    //         else
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1314,inputData)
                    //         }
                    //     }
                    // }

                    A_NumberInput{
                        inputWidth: 300
                        text: Cpp_PLC.Location_Compensate_07
                        minValue: -9
                        maxValue: 20
                        keyboard: locationSettingKeyboard

                        onEditingFinished: function(value) {
                            Cpp_PLC.write_Modbus_RTU_Hold_32(1314,value)
                        }
                    }

                    A_Label{
                        label_Data: "4250"
                        label_pointSize: 40
                    }

                    // A_TextInput{
                    //     inputWidth: 300
                    //     showData: Cpp_PLC.Location_Compensate_17

                    //     onInputFinished: {
                    //         if(Number(inputData) < -9)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1334,"-9")
                    //         }
                    //         else if(Number(inputData) > 20)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1334,"20")
                    //         }
                    //         else
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1334,inputData)
                    //         }
                    //     }
                    // }

                    A_NumberInput{
                        inputWidth: 300
                        text: Cpp_PLC.Location_Compensate_17
                        minValue: -9
                        maxValue: 20
                        keyboard: locationSettingKeyboard

                        onEditingFinished: function(value) {
                            Cpp_PLC.write_Modbus_RTU_Hold_32(1334,value)
                        }
                    }

                }

            }

            Item{

                width: 1040
                height: 100

                RowLayout{
                    anchors.verticalCenter: parent.verticalCenter

                    A_Label {
                        label_Data: "2000"
                        label_pointSize: 40
                    }

                    // A_TextInput{
                    //     inputWidth: 300
                    //     showData: Cpp_PLC.Location_Compensate_08

                    //     onInputFinished: {
                    //         if(Number(inputData) < -9)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1316,"-9")
                    //         }
                    //         else if(Number(inputData) > 20)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1316,"20")
                    //         }
                    //         else
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1316,inputData)
                    //         }
                    //     }
                    // }

                    A_NumberInput{
                        inputWidth: 300
                        text: Cpp_PLC.Location_Compensate_08
                        minValue: -9
                        maxValue: 20
                        keyboard: locationSettingKeyboard

                        onEditingFinished: function(value) {
                            Cpp_PLC.write_Modbus_RTU_Hold_32(1316,value)
                        }
                    }

                    A_Label{
                        label_Data: "4500"
                        label_pointSize: 40
                    }

                    // A_TextInput{
                    //     inputWidth: 300
                    //     showData: Cpp_PLC.Location_Compensate_18

                    //     onInputFinished: {
                    //         if(Number(inputData) < -9)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1336,"-9")
                    //         }
                    //         else if(Number(inputData) > 20)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1336,"20")
                    //         }
                    //         else
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1336,inputData)
                    //         }
                    //     }
                    // }

                    A_NumberInput{
                        inputWidth: 300
                        text: Cpp_PLC.Location_Compensate_18
                        minValue: -9
                        maxValue: 20
                        keyboard: locationSettingKeyboard

                        onEditingFinished: function(value) {
                            Cpp_PLC.write_Modbus_RTU_Hold_32(1336,value)
                        }
                    }

                }

            }

            Item{

                width: 1040
                height: 100

                RowLayout{
                    anchors.verticalCenter: parent.verticalCenter

                    A_Label {
                        label_Data: "2250"
                        label_pointSize: 40
                    }

                    // A_TextInput{
                    //     inputWidth: 300
                    //     showData: Cpp_PLC.Location_Compensate_09

                    //     onInputFinished: {
                    //         if(Number(inputData) < -9)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1318,"-9")
                    //         }
                    //         else if(Number(inputData) > 20)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1318,"20")
                    //         }
                    //         else
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1318,inputData)
                    //         }
                    //     }
                    // }

                    A_NumberInput{
                        inputWidth: 300
                        text: Cpp_PLC.Location_Compensate_09
                        minValue: -9
                        maxValue: 20
                        keyboard: locationSettingKeyboard

                        onEditingFinished: function(value) {
                            Cpp_PLC.write_Modbus_RTU_Hold_32(1318,value)
                        }
                    }

                    A_Label{
                        label_Data: "4750"
                        label_pointSize: 40
                    }

                    // A_TextInput{
                    //     inputWidth: 300
                    //     showData: Cpp_PLC.Location_Compensate_19

                    //     onInputFinished: {
                    //         if(Number(inputData) < -9)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1338,"-9")
                    //         }
                    //         else if(Number(inputData) > 20)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1338,"20")
                    //         }
                    //         else
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1338,inputData)
                    //         }
                    //     }
                    // }

                    A_NumberInput{
                        inputWidth: 300
                        text: Cpp_PLC.Location_Compensate_19
                        minValue: -9
                        maxValue: 20
                        keyboard: locationSettingKeyboard

                        onEditingFinished: function(value) {
                            Cpp_PLC.write_Modbus_RTU_Hold_32(1338,value)
                        }
                    }

                }

            }

            Item{

                width: 1040
                height: 100

                RowLayout{
                    anchors.verticalCenter: parent.verticalCenter

                    A_Label {
                        label_Data: "2500"
                        label_pointSize: 40
                    }

                    // A_TextInput{
                    //     inputWidth: 300
                    //     showData: Cpp_PLC.Location_Compensate_10

                    //     onInputFinished: {
                    //         if(Number(inputData) < -9)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1320,"-9")
                    //         }
                    //         else if(Number(inputData) > 20)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1320,"20")
                    //         }
                    //         else
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1320,inputData)
                    //         }
                    //     }
                    // }

                    A_NumberInput{
                        inputWidth: 300
                        text: Cpp_PLC.Location_Compensate_10
                        minValue: -9
                        maxValue: 20
                        keyboard: locationSettingKeyboard

                        onEditingFinished: function(value) {
                            Cpp_PLC.write_Modbus_RTU_Hold_32(1320,value)
                        }
                    }

                    A_Label{
                        label_Data: "5000"
                        label_pointSize: 40
                    }

                    // A_TextInput{
                    //     inputWidth: 300
                    //     showData: Cpp_PLC.Location_Compensate_20

                    //     onInputFinished: {
                    //         if(Number(inputData) < -9)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1340,"-9")
                    //         }
                    //         else if(Number(inputData) > 20)
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1340,"20")
                    //         }
                    //         else
                    //         {
                    //             Cpp_PLC.write_Modbus_RTU_Hold_32(1340,inputData)
                    //         }
                    //     }
                    // }

                    A_NumberInput{
                        inputWidth: 300
                        text: Cpp_PLC.Location_Compensate_20
                        minValue: -9
                        maxValue: 20
                        keyboard: locationSettingKeyboard

                        onEditingFinished: function(value) {
                            Cpp_PLC.write_Modbus_RTU_Hold_32(1340,value)
                        }
                    }

                }
            }
        }

    }

    Rectangle{
        anchors.top: parent.top
        anchors.topMargin: 1070
        anchors.horizontalCenter: parent.horizontalCenter
        width: rootWidth - 20
        height: 300
        color: "transparent"
        border.width: 1


        A_Label{
            anchors.top: parent.top
            anchors.topMargin: 10
            anchors.horizontalCenter: parent.horizontalCenter
            label_Data: qsTr("摆 角 专 补")
            labelWidth: 400
            labelHeight: 70
        }



        RowLayout{
            anchors.top: parent.top
            anchors.topMargin: 100
            anchors.horizontalCenter: parent.horizontalCenter


            Item{
                width: 250
                height: 200

                A_Label{
                    anchors.top: parent.top
                    anchors.topMargin: 10
                    anchors.horizontalCenter: parent.horizontalCenter
                    label_Data: qsTr("位置下限")
                }

                // A_TextInput{
                //     anchors.top: parent.top
                //     anchors.topMargin: 100
                //     anchors.horizontalCenter: parent.horizontalCenter
                //     inputWidth: 240
                //     showData: Cpp_PLC.SpecialCompensate_DownLimit

                //     onInputFinished: {
                //         if(Number(inputData) < 0)
                //         {
                //             Cpp_PLC.write_Modbus_RTU_Hold_32(1374,"0")
                //         }
                //         else if(Number(inputData) > 9999)
                //         {
                //             Cpp_PLC.write_Modbus_RTU_Hold_32(1374,"9999")
                //         }
                //         else
                //         {
                //             Cpp_PLC.write_Modbus_RTU_Hold_32(1374,inputData)
                //         }
                //     }

                // }

                A_NumberInput{
                    anchors.top: parent.top
                    anchors.topMargin: 100
                    anchors.horizontalCenter: parent.horizontalCenter
                    inputWidth: 240
                    text: Cpp_PLC.SpecialCompensate_DownLimit
                    minValue: 0
                    maxValue: 9999
                    keyboard: locationSettingKeyboard

                    onEditingFinished: function(value) {
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1374,value)
                    }
                }

            }
            Item{
                width: 250
                height: 200

                A_Label{
                    anchors.top: parent.top
                    anchors.topMargin: 10
                    anchors.horizontalCenter: parent.horizontalCenter
                    label_Data: qsTr("位置上限")
                }

                // A_TextInput{
                //     anchors.top: parent.top
                //     anchors.topMargin: 100
                //     anchors.horizontalCenter: parent.horizontalCenter
                //     inputWidth: 240
                //     showData: Cpp_PLC.SpecialCompensate_UpLimit

                //     onInputFinished: {
                //         if(Number(inputData) < 0)
                //         {
                //             Cpp_PLC.write_Modbus_RTU_Hold_32(1376,"0")
                //         }
                //         else if(Number(inputData) > 9999)
                //         {
                //             Cpp_PLC.write_Modbus_RTU_Hold_32(1376,"9999")
                //         }
                //         else
                //         {
                //             Cpp_PLC.write_Modbus_RTU_Hold_32(1376,inputData)
                //         }
                //     }
                // }

                A_NumberInput{
                    anchors.top: parent.top
                    anchors.topMargin: 100
                    anchors.horizontalCenter: parent.horizontalCenter
                    inputWidth: 240
                    text: Cpp_PLC.SpecialCompensate_UpLimit
                    minValue: 0
                    maxValue: 9999
                    keyboard: locationSettingKeyboard

                    onEditingFinished: function(value) {
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1376,value)
                    }
                }

            }
            Item{
                width: 250
                height: 200

                A_Label{
                    anchors.top: parent.top
                    anchors.topMargin: 10
                    anchors.horizontalCenter: parent.horizontalCenter
                    label_Data: qsTr("补偿值")
                }

                // A_TextInput{
                //     anchors.top: parent.top
                //     anchors.topMargin: 100
                //     anchors.horizontalCenter: parent.horizontalCenter
                //     inputWidth: 240
                //     showData: Cpp_PLC.SpecialCompensateValue

                //     onInputFinished: {
                //         if(Number(inputData) < -99)
                //         {
                //             Cpp_PLC.write_Modbus_RTU_Hold_32(1378,"-99")
                //         }
                //         else if(Number(inputData) > 99)
                //         {
                //             Cpp_PLC.write_Modbus_RTU_Hold_32(1378,"99")
                //         }
                //         else
                //         {
                //             Cpp_PLC.write_Modbus_RTU_Hold_32(1378,inputData)
                //         }
                //     }
                // }

                A_NumberInput{
                    anchors.top: parent.top
                    anchors.topMargin: 100
                    anchors.horizontalCenter: parent.horizontalCenter
                    inputWidth: 240
                    text: Cpp_PLC.SpecialCompensateValue
                    minValue: -99
                    maxValue: 99
                    keyboard: locationSettingKeyboard

                    onEditingFinished: function(value) {
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1378,value)
                    }
                }

            }

            Item{
                width: 250
                height: 200

                A_Label{
                    anchors.top: parent.top
                    anchors.topMargin: 10
                    anchors.horizontalCenter: parent.horizontalCenter
                    label_Data: qsTr("启用开关")
                }

                A_Button{
                    anchors.top: parent.top
                    anchors.topMargin: 100
                    anchors.horizontalCenter: parent.horizontalCenter
                    // contentText_Fontsize: 40
                    contentText_Data: Cpp_PLC.SpecialCompensate_State ? qsTr("已启用") : qsTr("已禁用")
                    contentText_Color: Cpp_PLC.SpecialCompensate_State ?  "red" : "black"

                    // onButtonPressed: {
                    //     Cpp_PLC.write_Modbus_RTU_Coils(115,"1")
                    // }

                    // onButtonReleased: {
                    //     Cpp_PLC.write_Modbus_RTU_Coils(115,"0")
                    // }
                    onButtonClicked: {
                        if(Cpp_PLC.SpecialCompensate_State)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(421,"0")
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(421,"1")
                        }
                    }

                }
            }

        }


    }



    Rectangle{
        anchors.top: parent.top
        anchors.topMargin: 1380
        anchors.horizontalCenter: parent.horizontalCenter
        width: rootWidth - 20
        height: 200
        color: "transparent"
        border.width: 1


        RowLayout{
            anchors.horizontalCenter: parent.horizontalCenter
            spacing: 100
            Item{
                width: 250
                height: 200

                A_Label{
                    anchors.top: parent.top
                    anchors.topMargin: 10
                    anchors.horizontalCenter: parent.horizontalCenter
                    label_Data: qsTr("料长设定")
                }

                // A_TextInput{
                //     anchors.top: parent.top
                //     anchors.topMargin: 100
                //     anchors.horizontalCenter: parent.horizontalCenter
                //     inputWidth: 240
                //     showData: Cpp_PLC.MaterialLengthValue

                //     onInputFinished: {
                //         if(Number(inputData) < Number(Cpp_PLC.Manual_MaterialLengthMin))
                //         {
                //             Cpp_PLC.write_Modbus_RTU_Hold_32(212,Cpp_PLC.Manual_MaterialLengthMin)
                //         }
                //         else if( Number(inputData) > Number(Cpp_PLC.Manual_MaterialLengthMax))
                //         {
                //             Cpp_PLC.write_Modbus_RTU_Hold_32(212,Cpp_PLC.Manual_MaterialLengthMax)
                //         }
                //         else
                //         {
                //             Cpp_PLC.write_Modbus_RTU_Hold_32(212,inputData)
                //         }
                //     }
                // }

                A_NumberInput{
                    anchors.top: parent.top
                    anchors.topMargin: 100
                    anchors.horizontalCenter: parent.horizontalCenter
                    inputWidth: 240
                    text: Cpp_PLC.MaterialLengthValue
                    minValue: Cpp_PLC.Manual_MaterialLengthMin
                    maxValue: Cpp_PLC.Manual_MaterialLengthMax
                    keyboard: locationSettingKeyboard

                    onEditingFinished: function(value) {
                        Cpp_PLC.write_Modbus_RTU_Hold_32(212,value)
                    }
                }

            }

            A_Button{
                Layout.topMargin: 70
                // contentText_Fontsize: 40
                contentText_Data: qsTr("复 位")
                onButtonPressed: {
                    // console.log("复位按下")
                    Cpp_PLC.write_Modbus_RTU_Coils(5,"1")
                }

                onButtonReleased: {
                    // console.log("复位松开")
                    Cpp_PLC.write_Modbus_RTU_Coils(5,"0")
                }
            }

            A_Button{
                Layout.topMargin: 70
                // contentText_Fontsize: 40
                contentText_Data: qsTr("定 位")
                onButtonPressed: {
                    // console.log("定位按下")
                    Cpp_PLC.write_Modbus_RTU_Coils(24,"1")
                }

                onButtonReleased: {
                    // console.log("定位松开")
                    Cpp_PLC.write_Modbus_RTU_Coils(24,"0")
                }
            }

        }


    }















}
